package com.tedu.mybatistest.mapper;

import com.tedu.mybatistest.pojo.Product;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface ProductMapper {
    @Insert("INSERT INTO product(title,price,stock) " +
            "VALUES(#{title},#{price},#{stock})")
    int insert(Product product);
    @Update("UPDATE product SET price=#{price} WHERE id=#{id}")
    int update(Product product);

    @Delete("DELETE FROM product WHERE id=#{id}")
    int delete(Integer id);
}
